package org.example.travel.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.travel.entity.ScenicLog;

import java.time.LocalDateTime;

@Mapper
public interface ScenicLogMapper extends BaseMapper<ScenicLog> {
    /**
     * 删除 create_time 早于指定时间的日志记录（用于定时清理旧数据）
     */
    @Delete("DELETE FROM scenic_log WHERE create_time < #{cutoff}")
    int deleteLogsBefore(@Param("cutoff") LocalDateTime cutoff);
}
